// pages/personal/myPromote/index/index.js
import api from '../../../../utils/api'
import Dialog from '@vant/weapp/dialog/dialog';
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		serData: '',
		show: false,
		type: null,
	},
	dialog() {
		var that = this
		that.setData({
			show: true
		})
	},
	goQrcode() {
		//去二维码页面
		wx.navigateTo({
			url: '/pages/personal/myPromote/qrcode/qrcode?type=' + this.data.type
		})
	},
	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function(options) {
		let that = this;
		let apis = api.api;
		let url = apis.host + "sys/sysconfig";
		let data = {};
		var type = options.type
		var WxParse = require('../../../wxParse/wxParse.js');
		var p = '<p>我是HTML代码</p>';
		that.setData({
			type: type
		})
		apis.request(url, data, 'POST').then(function(res) {
			that.setData({
				serData: res.data.server
			})
			var conts = that.data.serData.my_user_tuiguang_page
			var cont = that.data.serData.my_user_tuiguang_guize_page
			WxParse.wxParse('conts', 'html', conts, that, 0);
			WxParse.wxParse('cont', 'html', cont, that, 0);
		}).catch(function(res) {
			console.log('请求失败', res)
		})
	},
	goMyacom() {
		wx.navigateTo({
			url: '/pages/personal/myPromote/usersRecom/usersRecom'
		})
	},
	onShareAppMessage(e) {
		console.log('转发', e)
	}
})
